Guest User

Untitled

a guest
Apr 4th, 2023
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. # Generated by a fuckwit (named joe), don't trust this
  2.  
  3. loadrt [KINS]KINEMATICS
  4. #autoconverted trivkins
  5. loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
  6.  
  7. loadrt corexy_by_hal names=corexy
  8.  
  9. loadusr -W lcec_conf ethercat-conf.xml
  10. loadusr linuxcncrsh
  11. loadrt lcec
  12. loadrt cia402 count=3
  13. loadrt pid names=0-pid,1-pid
  14.  
  15. addf lcec.read-all servo-thread
  16. addf cia402.0.read-all servo-thread
  17. addf cia402.1.read-all servo-thread
  18. addf cia402.2.read-all servo-thread
  19. addf corexy servo-thread
  20. addf motion-command-handler servo-thread
  21. addf motion-controller servo-thread
  22. addf 0-pid.do-pid-calcs servo-thread
  23. addf 1-pid.do-pid-calcs servo-thread
  24. addf cia402.0.write-all servo-thread
  25. addf cia402.1.write-all servo-thread
  26. addf cia402.2.write-all servo-thread
  27. addf lcec.write-all servo-thread
  28.  
  29. # --- ect60 settings
  30. setp cia402.0.csp-mode 1
  31. setp cia402.0.pos-scale 133.33
  32.  
  33. #net input-test <= lcec.0.2.input-test
  34.  
  35. # AXIS X
  36. # --- joint signals for motion and driver to joint
  37. net j0motor-cmd <= joint.0.motor-pos-cmd => corexy.j0-motor-pos-cmd
  38. net alpha-cmd <= corexy.alpha-cmd => cia402.0.pos-cmd
  39. net alpha-fb <= cia402.0.pos-fb => corexy.alpha-fb
  40. net j0motor-fb <= corexy.j0-motor-pos-fb => joint.0.motor-pos-fb
  41. net j0enable <= joint.0.amp-enable-out => cia402.0.enable
  42. net x-home <= lcec.0.2.x-min => joint.0.home-sw-in
  43.  
  44. # --- from stepper(ethercat) to cia402
  45. net x-statusword lcec.0.0.cia-statusword => cia402.0.statusword
  46. net x-opmode-display lcec.0.0.opmode-display => cia402.0.opmode-display
  47. net x-drv-act-pos lcec.0.0.actual-position => cia402.0.drv-actual-position
  48. net x-drv-act-velo lcec.0.0.actual-velocity => cia402.0.drv-actual-velocity
  49.  
  50. # --- from cia402 to stepper(ethercat)
  51. net x-controlword cia402.0.controlword => lcec.0.0.cia-controlword
  52. net x-modes-of-operation cia402.0.opmode => lcec.0.0.opmode
  53. net x-drv-target-pos cia402.0.drv-target-position => lcec.0.0.target-position
  54. net x-drv-target-velo cia402.0.drv-target-velocity => lcec.0.0.target-velocity
  55.  
  56.  
  57. #*******************
  58. # AXIS Y
  59. #*******************
  60.  
  61. net j1motor-cmd <= joint.1.motor-pos-cmd => corexy.j1-motor-pos-cmd
  62. net beta-cmd <= corexy.beta-cmd => cia402.1.pos-cmd
  63. net beta-fb <= cia402.1.pos-fb => corexy.beta-fb
  64. net j1motor-fb <= corexy.j1-motor-pos-fb => joint.1.motor-pos-fb
  65. net j1enable <= joint.1.amp-enable-out => cia402.1.enable
  66. net y-home <= lcec.0.2.y-min => joint.1.home-sw-in
  67.  
  68. # --- ect60 settings
  69.  
  70. setp cia402.1.csp-mode 1
  71. setp cia402.1.pos-scale 133.33
  72.  
  73. # --- from servo(ethercat) to cia402
  74.  
  75. net y-statusword lcec.0.1.cia-statusword => cia402.1.statusword
  76. net y-opmode-display lcec.0.1.opmode-display => cia402.1.opmode-display
  77. net y-drv-act-pos lcec.0.1.actual-position => cia402.1.drv-actual-position
  78. net y-drv-act-velo lcec.0.1.actual-velocity => cia402.1.drv-actual-velocity
  79.  
  80. # --- from cia402 to servo(ethercat)
  81.  
  82. net y-controlword cia402.1.controlword => lcec.0.1.cia-controlword
  83. net y-modes-of-operation cia402.1.opmode => lcec.0.1.opmode
  84. net y-drv-target-pos cia402.1.drv-target-position => lcec.0.1.target-position
  85. net y-drv-target-velo cia402.1.drv-target-velocity => lcec.0.1.target-velocity
  86.  
  87. #setp cia402.2.opmode-no-mode 1
  88. setp cia402.2.pos-scale 250
  89.  
  90.  
  91. #from servo(ethercat) to cia402
  92. net z-statusword lcec.0.2.cia-statusword => cia402.2.statusword
  93. net z-opmode-display lcec.0.2.opmode-display => cia402.2.opmode-display
  94. net z-drv-act-pos lcec.0.2.actual-position => cia402.2.drv-actual-position
  95. net z-drv-act-velo lcec.0.2.actual-velocity => cia402.2.drv-actual-velocity
  96.  
  97. #from motion to cia
  98.  
  99. net z-enable <= joint.2.amp-enable-out => cia402.2.enable
  100. net z-amp-fault => joint.2.amp-fault-in <= cia402.2.drv-fault
  101. net z-pos-cmd <= joint.2.motor-pos-cmd => cia402.2.pos-cmd
  102. net z-pos-fb => joint.2.motor-pos-fb <= cia402.2.pos-fb
  103. net z-home <= lcec.0.2.z-min => joint.2.home-sw-in
  104.  
  105. #from cia402 to servo(ethercat)
  106. net z-controlword cia402.2.controlword => lcec.0.2.cia-controlword
  107. net z-modes-of-operation cia402.2.opmode => lcec.0.2.opmode
  108. net z-drv-target-pos cia402.2.drv-target-position => lcec.0.2.target-position
  109. net z-drv-target-velo cia402.2.drv-target-velocity => lcec.0.2.target-velocity
  110.  
  111.  
  112.  
  113. net estoploop iocontrol.0.emc-enable-in => iocontrol.0.user-enable-out
  114. net spindle-on spindle.0.on => lcec.0.2.out-1-en => lcec.0.2.out-1
Add Comment
Please, Sign In to add comment